<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/all.min.css">
    <script src="/js/jquery-3.5.1.min.js"></script>
    <link href="/layui/css/layui.css" rel="stylesheet">
    <script src="/layui/layui.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <title>MBTI 后台管理系统 - 配置设置</title>
    <style>
       body {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* 苹果系统字体 */
    }
    .content {
        padding: 20px;
    }
    </style>
</head>
<body>
    <div class="content">
        <h2>配置设置</h2>
        <!-- 错误提示模态框 -->
        {include file="./admin/window"}
        <form method="post" action=""  id="myForm" onsubmit="return false">
             <div class="form-group">
                <label for="domain">网站名称</label>
                <input type="text" class="form-control" name="site_name" value="{$mbti.site_name}" placeholder="">
            </div>
            <div class="form-group">
                <label for="title">标题</label>
                <input type="text" class="form-control" name="title"  value="{$mbti.title}" placeholder="输入标题">
            </div>
            <div class="form-group">
                <label for="keywords">关键词</label>
                <input type="text" class="form-control" name="keywords"  value="{$mbti.keywords}" placeholder="输入关键词">
            </div>
            <div class="form-group">
                <label for="description">描述</label>
                <textarea class="form-control" name="description" rows="3"  placeholder="输入描述">{$mbti.description}</textarea>
            </div>
            <div class="form-group">
                <label for="domain">域名</label>
                <input type="text" class="form-control" name="domain" value="{$mbti.domain}" placeholder="输入域名">
            </div>
            <div class="form-group">
                <label for="domain">微信号</label>
                <input type="text" class="form-control" name="wechat" value="{$mbti.wechat}" placeholder="">

            </div>
            <div class="form-group">
                <label for="domain">标准版价格</label>
                <input type="text" class="form-control" name="bzb" value="{$mbti.bzb}" placeholder="">

            </div>
            <div class="form-group">
                <label for="domain">专业版价格</label>
                <input type="text" class="form-control" name="zyb" value="{$mbti.zyb}" placeholder="">
            </div>
            <div class="form-group">
                <label for="domain">完整版价格</label>
                <input type="text" class="form-control" name="wzb" value="{$mbti.wzb}" placeholder="">
            </div>
               
            <input type="submit" class="btn btn-primary" id="postDF" value="保存设置">
        </form>
    </div>
</body>


<script>
    layui.use('form', function () {
        var form = layui.form;

    });
    $("#postDF").click(function () {
        $('#myForm').on('submit', function (event) {
            // 阻止表单的默认提交行为
            event.preventDefault();
            // 获取表单数据
            var formData = $(this).serialize();
            console.log(formData)
            // 使用 AJAX 提交表单数据
            $.ajax({
                url: $(this).attr('action'),
                method: $(this).attr('method'),
                data: formData,
                success: function (response) {
                    layer.msg("编辑成功", {icon: 1, shade: 0.5});

                },
                error: function (error) {
                }
        });
        });
    });
</script>
</html>